package com.joinlabs.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.joinlabs.entity.Forwarding;
import com.joinlabs.entity.Weibo;
import com.joinlabs.mapper.ForwardingMapper;
import com.joinlabs.mapper.WeiboMapper;
import com.joinlabs.service.IForwardService;

@Service("forwardService")
public class ForwardServiceImpl implements IForwardService {

	@Resource
	private ForwardingMapper forwardingMapper;
	@Resource
	private WeiboMapper weiboMapper;
	@Override
	public List<Forwarding> selectAllForward() {
		// TODO Auto-generated method stub
		List<Forwarding> list = forwardingMapper.selectAllForward();
		for (Forwarding forwarding : list) {
			Weibo w = weiboMapper.selectByPrimaryKey(forwarding.getWeibo().getWeiboId());
			forwarding.setWeibo(w);
		}
		return list;
	}

}
